<template>
  <div>{{info}}
  <button @click="getData">获取数据</button>
  </div>
</template>

<script>
  import axios from 'axios';
    export default {
        name: "MyTest",
      data(){
          return {
            info:""
          }
      },
      methods: {
        getData: function () {
          axios
            .post('https://www.runoob.com/try/ajax/demo_axios_post.php')
            .then(response => (this.info = response))
            .catch(function (error) { // 请求失败处理
              console.log("1111111111111"+error);
            });

        }
      }
    }
</script>

<style scoped>

</style>
